package com.xiongwei.manageback.controller;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.Quarter;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xiongwei.manageback.domain.SysUser;
import com.xiongwei.manageback.service.SysUserService;
import com.xiongwei.manageback.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

@RestController
@RequestMapping("/echarts")
public class EchartsController {

    @Autowired
    private SysUserService userService;

    /**
     * 用户总数
     * @return
     */
    @GetMapping("/userCount")
    public AjaxResult getUserCount(){
        return AjaxResult.success(userService.count());
    }

    /**
     * 用户增长趋势 各个季度加入用户的数量
     * @return
     */
    @GetMapping("/userTendency")
    public AjaxResult getUserTendency(){
        return AjaxResult.success(userService.userTendency());
    }
}
